from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.http import HttpResponse
from django.shortcuts import render, redirect


# 获取构造地址 （页面进行初始化）
def Init_house_get_address():
    # 这里是模拟一个http 请求
    return [{"name": "bj"}, {"name": "sh"}]



# 验证官方工具的输入的房东账户验证( 用户输入关键新后，进阶初始化)
def Init_house_check_user(username, userpwd):
    #  模拟 http 请求
    # req = request.get(url, xxxx)
    if username == 'admin' and  userpwd == 'admin':
        return {"errCode": 0}
    else:
        return {"errCode": -1}
